perm filename MAPS[F8,ALS]1 blob sn#312014 filedate 1977-10-27 generic text, type C, neo UTF8
COMMENT ⊗   VALID 00011 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00002 00002	Board storaged in RAM  and copied into SC as shown
C00005 00003		     Board display arrangements
C00009 00004		Possible moves
C00011 00005	* Storage map
C00016 00006	Scratchpad Assignments
C00018 00007		      Data movement between levels when going forward
C00023 00008		      Data movement between levels when going backward
C00026 00009	Byte treatment during (jump) FIND operations
C00029 00010	Byte treatment during (non-jump) FIND operations
C00032 00011	Loading info
C00034 ENDMK
C⊗;
Board storaged in RAM  and copied into SC as shown

  At the end of a move the sides reverse.
   Active and Passive pieces are interchanged
   when written into the next ply level of RAM

	---------------------------------
	| |7| |6| |5| |4| |3| |2| |1| |0|  Byte 0	LISL 0
	---------------------------------
	| |7| |6| |5| |4| |3| |2| |1| |0|  Byte 1
Active	---------------------------------
	| |7| |6| |5| |4| |3| |2| |1| |0|  Byte 2
	---------------------------------
	| |7| |6| |5| |4| |3| |2| |1| |0|  Byte 3
---	---------------------------------  ---
	| |7| |6| |5| |4| |3| |2| |1| |0|  Byte 0
	---------------------------------
	| |7| |6| |5| |4| |3| |2| |1| |0|  Byte 1
Passive	---------------------------------
	| |7| |6| |5| |4| |3| |2| |1| |0|  Byte 2
	---------------------------------
	| |7| |6| |5| |4| |3| |2| |1| |0|  Byte 3	LISL 7
---	---------------------------------  ---
	| |7| |6| |5| |4| |3| |2| |1| |0|  Byte 0
	---------------------------------
	| |7| |6| |5| |4| |3| |2| |1| |0|  Byte 1
Kings  	---------------------------------
	| |7| |6| |5| |4| |3| |2| |1| |0|  Byte 2
	---------------------------------
	| |7| |6| |5| |4| |3| |2| |1| |0|  Byte 3
  	---------------------------------

	     Board display arrangements

		Machine playing RED

  X	7	-----------------
 7←0    ↑Y	| |R| |R| |R| |R|
        0	-----------------  Answer Y
		|R| |R| |R| |R| |
	Passive -----------------  COLO= -1
		| |R| |R| |R| |R|
		-----------------  Player to move first
		| | | | | | | | |
		-----------------  Enter SC,  LISL O'7'
		| | | | | | | | |  Display Red first
		-----------------  SR 1  and decrement
		|B| |B| |B| |B| |
	Active  -----------------  Display board initially
		| |B| |B| |B| |B|    and say "YOUR MOVE"
		-----------------
		|B| |B| |B| |B| |  Also display afteer
		-----------------    player's move

  Test legal black moves, and for random first move selection
   (8 entries to simplfy random number generation)
  BLKM   DC      B'11110000'      4 pieces
	 DC      B'00000100'      Byte 1, RF
	 DC      B'11100000'      3 pieces
	 DC      B'00000101'      Byte 1, LF
         DC      B'01000000'      (11-15) repeat
	 DC      B'00000100'      Byte 1, RF
	 DC      H'00'

	*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-

		Machine playing BLACK

 X	0	-----------------
0→7	↓Y	| |B| |B| |B| |B|
        7	-----------------  Answer N
		|B| |B| |B| |B| |
	Passive -----------------  COLO= 0
		| |B| |B| | | |B|
		-----------------  Machine move 11-15 shown
		| | | | |B| | | |
		-----------------  Enter SC,  LISL O'0'
		| | | | | | | | |  Display Red first
		-----------------  SL 1  and increment
		|R| |R| |R| |R| |
	Active  -----------------  Do not show board untill
		| |R| |R| |R| |R|     after machine's move
		-----------------     and after side reversal
		|R| |R| |R| |R| |
		-----------------

  Chose Black's move by lot from BLKM (above)
  Then  test legal moves for red
  REDM   DC      B'00000111'      3 pieces
	 DC      B'00001010'      Byte 2, RB
	 DC      B'00001111'      4 pieces
	 DC      B'00001011'      Byte 2, LB
	 DC      H'00'
	Possible moves

Black's first moves

Move	Byte	#	X0	Y0	X1	Y1	∂X	∂Y	Dir

9-13	80	01	01	02	00	03	-1	1	RF
9-14	80	01	01	02	02	03	1	1	LF
10-14	40	01	03	02	02	03	-1	1	RF
10-15	40	01	03	02	04	03	1	1	LF
11-15	20	01	05	02	04	03	-1	1	RF
11-16	20	01	05	02	06	03	1	1	LF
12-16	10	01	07	02	06	03	-1	1	RF

Red's first moves

Move	Byte	#	X0	Y0	X1	Y1	∂X	∂Y	Dir
	
21-17	08	02	00	05	01	04	1	-1	LB
22-17	04	02	02	05	01	04	-1	-1	RB
22-18	04	02	02	05	03	04	1	-1	LB
23-18	02	02	04	05	03	04	-1	-1	RB
23-19	02	02	04	05	05	04	1	-1	LB
24-19	01	02	06	05	05	04	-1	-1	RB
24-20	01	02	06	05	07	04	1	-1	LB

		   Square assignments

			   RED 
		-------------------------
		|  |32|  |31|  |30|  |29|
		-------------------------
		|28|  |27|  |26|  |25|  |	↑ Forward
		-------------------------	↓ Backward
		|  |24|  |23|  |22|  |21|	→ Right
		-------------------------	← Left
		|20|  |19|  |18|  |17|  |
		-------------------------
		|  |16|  |15|  |14|  |13|
		-------------------------
		|12|  |11|  |10|  | 9|  |
		-------------------------
		|  | 8|  | 7|  | 6|  | 5|
		-------------------------
		| 4|  | 3|  | 2|  | 1|  |
		-------------------------
			 BLACK

Black pieces go on low numbered squares and Black plays first
* Storage map
	 _______________________________________________________________
Image ar|_______________________________|_______________________________|
  10	|_______________________________|_______________________________|
  lines	|_______________________________|_______________________________|
  per	|_______________________________|_______________________________|
__row___|_______________________________|_______________________________|

Ply ar. |Active pieces	|Passive pieces	| Kings		|Mov|inf|ACT|PAS|

	| 0   1   2   3 | 4   5   6   7 | 8   9   A   B | C   D   E   F |
H'0C00'	| Used by RES.	|		|		|		|
H'0C10'	|___________ ___|_______________|_______________|_______________|
H'0B20'	|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|see below
H'0C30'	| Row 1  of the	| board image	|		|		|
	|_______________|______________	|_______________|_______________|
H'0C80'	| Row 2		|		|		|		|
	|_______________|_______________|_______________|_______________|
H'0CD0'	| Row 3		|		|		|		|
	|_______________|_______________|_______________|_______________|
H'0D20'	| Row 4		|		|		|		|
	|_______________|_______________|_______________|_______________|
H'0D70'	| Row 5		|		|		|		|
	|_______________|_______________|_______________|_______________|
H'0DC0'	| Row 6		|		|		|		|
	|_______________|_______________|_______________|_______________|
H'0E10'	| Players board	|		|		|		|
H'0E20'	| PLY 0		|		|		|		|
H'0E30'	| Ply 1		|		|		|		|
H'0E40'	| Ply 2		|		|   ____________|_______________|
H'0E50'	| Ply 3	_______	|_______________|___|HU_|HL_|PLM+D__+___+___|TX |
H'0E60'	| PLY 4	 H'0E5F'| thru	'H'0ECE'|		|		|
H'0E70'	| PLY 5		|overwritten by	|text display	|		|
H'0E80'	| PLY 6		| to tell player|that it is his	|move		|
H'0E90'	| PLY 7		|		|		|		|
H'0EA0'	| PLY 8		|		|		|		|
H'0EB0'	| PLY 9		|		|		|	    ____|
H'0EC0'	| PLY 10 _______|_______________|_______________|___________|___|
H'0ED0'	| PLY 11 _______|_Overwritten___|_by PLMV_______|_______________|
 '0EE0'	| PLY 12 _______|_______________|_______________|_______________|
H'0EF0'	|_SCOR   |      |       |       |       |       |_______|_______|
H'0F00'	|_______________|_______________|_______________|_XPOS______|YPO|
H'0F10'	| Row 7  of the	| board image	|		|		|
	|_______________|_______________|_______________|_______________|
H'0F60'	| Row 8		|		|		|		|
	|_______________|_______________|_______________|_______________|
H'0FB0'	|__MOBS_________|_______________|_______________|_______________|
H'0FC0'	|_______________|_______________|


	 _______________________________________________________
H'0B20'	|_PLY0_|_COL0_|_SELX_|_XPOS_+______+______|_YPOS_|_BFLG_|
	 _______________________________________________________
H'0B28'	|_BLNF_|_XBLN_|_YBLN_|_BCNT_|_BKMV_|______|______|______|


Scratchpad Assignments

Octal	Usage

0	General purpose
1	General purpose
2	Mobility during FIND and King move flag during SELECT
3	Move byte during FIND and Move bit during SELECT
4	Byte number and direction
5	K bit and move direction
6	Initial move bit
7	Color, (from H'0F0F' initially and updated in step with ply depth

10	Reserved for the interrupt routine
11	J
12	H  high order byte
13	H  low order byte
14	K  high order byte
15	K  low order byte
16	Q, high order
17	Q, low order

20
21
22
23
24
25      Interrogate last 6 bits for random number
26
27

30	Active pieces, 1st byte
31	Active pieces, 2st byte
32	Active pieces, 3rd byte
33	Active pieces, 4rd byte
34	Passive pieces, 1st byte
35	Passive pieces, 2nd byte
36	Passive pieces, 3rd byte
37	Passive pieces, 4th byte

40	Kings, 1st byte
41	Kings, 2nd byte
42	Kings, 3rd byte
43	Kings, 4th byte
44	Move byte
45	Byte identifying data
46	Score, high order
47	Score, low order

50	EMPTY guard byte (all zero's)
51	EMPTY 1st byte
52	EMPTY 2nd byte
53	EMPTY 3rd byte
54	EMPTY 4th byte
55	EMPTY guard byte )all zero's)
56
57

60
61
62
63
64
65
66
67

70
71
72
73
74
75
76
77
	      Data movement between levels when going forward
			RAM
	      -------------------------
	      |--                   --|		Data copied from RAM to SC
	      |--     Active        --|		at start of Find or SELE
	      |--                   --|
	      |-----------------------|		Data copied from SC to RAM
	      |--                   --|		after completion of SELE
	      |--     Passive       --|
	      |--                   --|
	      |-----------------------|
	      |--                   --|		------
	      |--     Kings         --|	       |3-bit Material Advantage
	      |--                   --|	     .←|portion only
	      |-----------------------|      ↓  ------
	      | Byte /M.A.,Byte Info  |→→→→→→→→→.
	      |-----------------------          ↓
	      |       Score           |→→→→→→→. ↓
	      -------------------------       ↓ ↓
	                                      ↓ ↓        Scratch
	      -------------------------       ↓ ↓  -------------------------
	      |--                   --|       ↓ ↓  |--     Modified      --|
	      |--      Active       --|→→→→→→→+→+→→|--        by         --|
	      |--                   --|     .←+←+→→|--       SELE        --|
	      |-----------------------|     ↓ ↓ ↓  |-----------------------|
	      |--                   --|     ↓ ↓ ↓  |--     Modified      --|
	      |--      Passive      --|→→→→→+→+→+→→|--        by         --|
	      |--                   --| .←←←+←+←+→→|--       SELE        --|
	      |-----------------------| ↓   ↓ ↓ ↓  |-----------------------|
	      |--                   --| ↓   ↓ ↓ ↓  |--     Modified      --|
	      |--      Kings        --|→+→→→+→+→+→→|--        by         --|
--------.     |--                   --| ↓ .←+←+←+←←|--       SELE        --|
Computed|     |-----------------------| ↓ ↓ ↓ ↓ ↓  |-----------------------|
   by   |→→→→→|-- Byte / Byte Info  --| ↓ ↓ ↓ ↓ :=↔|--    /Mat. Adv,     --|
  FIND  |     |-----------------------| ↓ ↓ ↓ ↓ ↓  |-----------------------|
Modified|     |--     Score         --| ↓ ↓ ↓ :=+=↔|--      Score        --|
   by   |     ------------------------- ↓ ↓ ↓ ↓ ↓  -------------------------
  SELE  |                               ↓ ↓ ↓ ↓ ↓
--------.                               ↓ ↓ ↓ ↓ ↓   ------
	      ------------------------- ↓ ↓ ↓ ↓←↓←←←|Material Advantage
	      |--                   --| ↓ ↓ ↓ ↓ ↓   |portion only
	      |--     Active        --|←. ↓ ↓ ↓ ↓   |Stored in left 3 bits
	      |--                   --|   ↓ ↓ ↓ ↓   |of Byte-Info byte
	      |-----------------------|   ↓ ↓ ↓ ↓   ------
	      |--                   --|   ↓ ↓ ↓ ↓
	      |--     Passive       --|←←←+ . ↓ ↓
	      |--                   --|   ↓   ↓ ↓
	      |-----------------------|   ↓   ↓ ↓
	      |--                   --|   ↓   ↓ ↓
	      |--     Kings         --|←←←.   ↓ ↓
	      |--                   --|       ↓ ↓
	      |-----------------------|       ↓ ↓
	      |-/Material Advantage --|←←←←←←←+ .
	      |-----------------------|       ↓
	      |--     Score         --|←←←←←←←.
	      -------------------------

	      Data movement between levels when going backward
			RAM
	      -------------------------
	      |--                   --|
	      |--     Active        --|
	      |--                   --|
	      |-----------------------|
	      |--                   --|
	      |--     Passive       --|
	      |--                   --|
	      |-----------------------|
	      |--                   --|
	      |--     Kings         --|
	      |--                   --|
	      |-----------------------|
	      | Byte    / Byte Info   |
	      |-----------------------|
	      |       Score           |
	      -------------------------


	      -------------------------
	      |--                   --|
	      |--     Active        --|
	      |--                   --|
	      |-----------------------|
	      |--                   --|
	      |--     Passive       --|
	      |--                   --|
	      |-----------------------|
	      |--                   --|
	      ∨--     Kings         --|
	      |--                   --|
	      |-----------------------|
	      | Byte    / Byte Info   |
	      |-----------------------|
	      |       Score           |
	      -------------------------


	      -------------------------
	      |--                   --|
	      |--     Active        --|
	      |--                   --|
	      |-----------------------|
	      |--                   --|
	      |--     Passive       --|
	      |--                   --|
	      |-----------------------|
	      |--                   --|
	      |--     Kings         --|
	      |--                   --|
	      |-----------------------|
	      | Byte    / Byte Info   |
	      |-----------------------|
	      |       Score           |
	      -------------------------


Byte treatment during (jump) FIND operations
  All routines repeated 4 times for n from 0 thru 3
  Bytes shown in vertical columns are AND'ed togather into S 3

			       RF jump moves

				----------
		Active byte	|	 |
		  ASA+n		----------
		King byte	|	 |   If (7)=-1
		  ASK+n		-----------
		Empty byte	 |	  | SR 1
		  ASE+n+1	 ----------
	       ---------------		    ---------------
Passive byte   |	| SL 4	←OR'ed→   SR 5	 |	  |  Passive byte
  ASP+n        ---------------		    ---------------    ASP+n+1

			       LF jump moves

				----------
		Active byte	|	 |
		  ASA+n		----------
		King byte	|	 |   If (7)=-1
		  ASK+n        -----------
		Empty byte     |	| SL 1
		  ASE+n+1      ----------
	       ---------------		    --------------
Passive byte   |	| SL 5	←OR'ed→   SR 4	|	 |  Passive byte
  ASP+n        ---------------		    --------------    ASP+n+1

			       RB jump moves

				----------
		Active byte	|	 |
		  ASA+n		----------
		King byte	|	 |   If (7)=0
		  ASK+n		-----------
		Empty byte	 |	  | SR 1
		  ASE+n-1	 ----------
		--------------		    ---------------
Passive byte	|	 | SL 4  ←OR ed→  SR 5	 |	  |  Passive byte
  ASP+n-1	--------------		    ---------------    ASP+n

			       LB jump moves

				----------
		Active byte	|	 |
		  ASA+n		----------
		King byte	|	 |   If (7)=0
		  ASK+n        -----------
		Empty byte     |	| SL 1
		  ASE+n-1      -----------
	       ---------------		    --------------
Passive byte   |	| SL 5	←OR'ed→   SR 4	|	 |  Passive byte
  ASP+n-1      ---------------		    --------------    ASP+n
Byte treatment during (non-jump) FIND operations
  All routines repeated 4 times for n from 0 thru 3
  Bytes shown in vertical columns are AND'ed togather into S 3

			   RF non-jump moves

			    ----------
	    Active byte     |	     |
	      ASA+n	    ----------
	    King byte	    |	     |	 If (7)=-1
	      ASK+n	    ----------
	    --------------		---------------
Empty byte  |	     | SL 4  ←OR'ed→  SR 5   |	      |  Empty byte
  ASE+n	    --------------		---------------    ASE+n+1

			   LF non-jump moves

			    ----------
	    Active byte     |	     |
	      ASA+n	    ----------
	    King byte	    |	     |	 If (7)=-1
	      ASK+n	    ----------
	   ---------------		--------------
Empty byte |	    | SL 5  ←OR'ed→   SR 4  |	     |	Empty byte
  ASE+n    ---------------		--------------	  ASE+n+1

			   RB non-jump moves

			    ----------
	    Active byte     |	     |
	      ASA+n	    ----------
	    King byte	    |	     |	 If (7)=0
	      ASK+n	    ----------
	    --------------		---------------
Empty byte  |	     | SL 4  ←OR'ed→  SR 5   |	      |  Empty byte
  ASE+n-1   --------------		---------------    ASE+n

			   LB non-jump moves

			    ----------
	    Active byte     |	     |
	      ASA+n	    ----------
	    King byte	    |	     |	 If (7)=0
	      ASK+n	    ----------
	   ---------------		--------------
Empty byte |	    | SL 5  ←OR'ed→   SR 4  |	     |	Empty byte
  ASE+n-1  ---------------		--------------	  ASE+n
Loading info
 
Playback light on
Rewind
Load point
Low switch, inside ans out
ADC off
Switch 110
Switch RAM
Switch 0000
Press CPU Reset to get response
Type L, responds L with space
Switch 300
High switch, inside only
Hit CR
Push CONT START
Light should be on and should be loading
On garbage press STOP
Rewind tape
Switch back to 110 and to Low inside
Press CPU reset
Type E 4000 cr

To set break point
Type B XXXX
when at break point read registers
ACC	FFBE
ISAR	FFBF
0	FFC0
1	FFC1
2	FFC2
3	FFC3
etc

On reaching a simple break point the code is reset so to continue
type E xxxx where xxxx is the breakpoint setting.
Setting  a break point twice makes it sticky and in this case the code
displaced by the break must be restored if one wants it back in.